﻿using System.ComponentModel.Composition;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using easytodoservice.Infrastructure;
using easytodoservice.Model;

namespace easytodoservice.Resources
{
    [ServiceContract]
    [Export]
    public class NotesResource
    {
        private readonly INoteRepository _repository;

        [ImportingConstructor]
        public NotesResource(INoteRepository repository)
        {
            _repository = repository;
        }

        [WebGet(UriTemplate = "")]
        public IQueryable<Note> Get()
        {
            return _repository.GetAll();
        }

    }
}
